﻿using System;

class Task2
{
    static void Main()
    {
        checked
        {
            int nRound = int.Parse(Console.ReadLine());
            int countV = 0;
            int countM = 0;
            //int newNumber;
        
            for (int i = 0; i < nRound; i++)
            {
                int number = int.Parse(Console.ReadLine());
                
                int digit = 1;
                int numberOfDigits = 0;
                for (int j = 0; j < 9; j++)
                {
                    if (number / digit > 0)
                    {
                        numberOfDigits += 1;
                    }
                    digit *= 10;
                }

                //if (numberOfDigits == 1)
                //{
                //    countV = countV + (number / 2);
                //    countM = countM + (number / 2);
                //}

                if (numberOfDigits % 2 == 0)    //четен брой числа в номера
                {
                    for (int k = 0; k < numberOfDigits / 2; k++)
                    {
                        countV = countV + number % 10;
                        number = number / 10;
                    }
                    for (int l = 0; l < numberOfDigits / 2; l++)
                    {
                        countM = countM + number % 10;
                        number = number / 10;
                    }
                }

                if (numberOfDigits % 2 != 0)    //нечетен брой числа в номера
                {
                    int lastdigit = 0;
                    for (int k = 0; k < (numberOfDigits / 2) + 1; k++)
                    {
                        lastdigit = number % 10;
                        countV = countV + number % 10;
                        number = number / 10;
                    }
                    number = number * 10 + lastdigit;
                    for (int l = 0; l < (numberOfDigits / 2) + 1; l++)
                    {
                        countM = countM + number % 10;
                        number = number / 10;
                    }
                }
            }
            

            if (countM > countV)
            {
                Console.WriteLine("M {0}", countM - countV);
            }
            else if (countV > countM)
            {
                Console.WriteLine("V {0}", countV - countM);
            }
            else if (countM == countV)
            {
                Console.WriteLine("No {0}", countM + countV);
            }        
        }
    }
}

